#include <string>
#include <iostream>
#include <map>
#include <vector>

using namespace std;

map<int, string> dic{
    {1, "I"},
    {2, "II"},
    {3, "III"},
    {4, "IV"},
    {5, "V"},
    {6, "VI"},
    {7, "VII"},
    {8, "VIII"},
    {9, "IX"},    
};
map<int, string> dic1{
    {1, "X"},
    {2, "XX"},
    {3, "XXX"},
    {4, "XL"},
    {5, "L"},
    {6, "LX"},
    {7, "LXX"},
    {8, "LXXX"},
    {9, "XC"},    
};
map<int, string> dic2{
    {1, "C"},
    {2, "CC"},
    {3, "CCC"},
    {4, "CD"},
    {5, "D"},
    {6, "DC"},
    {7, "DCC"},
    {8, "DCCC"},
    {9, "CM"},    
};
map<int, string> dic3{
    {1, "M"},
    {2, "MM"},
    {3, "MMM"},
    {4, "MMMM"},
    {5, "MMMMM"},
    {6, "MMMMMM"},
    {7, "MMMMMMM"},
    {8, "MMMMMMMM"},
    {9, "MMMMMMMMM"},    
};

string integerToRoman(int n){
    string result;
    int q = n / 1000;
    result.append(dic3[q]);
    n = n % 1000;
    q = n / 100;
    result.append(dic2[q]);
    n = n % 100;
    q = n / 10;
    result.append(dic1[q]);
    n = n % 10;
    q = n / 1;
    result.append(dic[q]);
    return result;
}

int main(int argc, char const *argv[])
{
    int n = 99;
    cout << integerToRoman(n);

    return 0;
}
